package net.edisoft.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;



@Entity
@Table(name="header")
public class Header implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1178152863730912256L;
	
	private Long id;
	private String documenttype;
	private String receiversystemtype;
	private Integer documentnumber;
	private Date documentdate1;
	private Date documentdate2;
	private Long senderiln;
	private Integer sendercodebyreceiver;
	private String sendername;
	private String senderaddress;
	private Long receiveriln;
	private Integer receivercodebyreceiver;
	private String receivername;
	private String receiveraddress;

	private Date created;
	
	private Set<Detail> lines;
	

	@Id
	@GeneratedValue
	@Column(name="id")
	public Long getId() {
		return id;
	}

	@Column(name="documenttype")
	public String getDocumenttype() {
		return documenttype;
	}

	public void setDocumenttype(String documenttype) {
		this.documenttype = documenttype;
	}

	@Column(name="receiversystemtype")
	public String getReceiversystemtype() {
		return receiversystemtype;
	}

	public void setReceiversystemtype(String receiversystemtype) {
		this.receiversystemtype = receiversystemtype;
	}

	@Column(name="documentnumber")
	public Integer getDocumentnumber() {
		return documentnumber;
	}

	public void setDocumentnumber(Integer documentnumber) {
		this.documentnumber = documentnumber;
	}

	@Column(name="documentdate1")
	public Date getDocumentdate1() {
		return documentdate1;
	}

	public void setDocumentdate1(Date date) {
		this.documentdate1 = date;
	}

	@Column(name="documentdate2")
	public Date getDocumentdate2() {
		return documentdate2;
	}

	public void setDocumentdate2(Date documentdate2) {
		this.documentdate2 = documentdate2;
	}

	@Column(name="senderiln")
	public Long getSenderiln() {
		return senderiln;
	}

	public void setSenderiln(Long senderiln) {
		this.senderiln = senderiln;
	}

	@Column(name="sendercodebyreceiver")
	public Integer getSendercodebyreceiver() {
		return sendercodebyreceiver;
	}

	public void setSendercodebyreceiver(Integer sendercodebyreceiver) {
		this.sendercodebyreceiver = sendercodebyreceiver;
	}

	@Column(name="sendername")
	public String getSendername() {
		return sendername;
	}

	public void setSendername(String sendername) {
		this.sendername = sendername;
	}

	@Column(name="senderaddress")
	public String getSenderaddress() {
		return senderaddress;
	}

	public void setSenderaddress(String senderaddress) {
		this.senderaddress = senderaddress;
	}

	@Column(name="receiveriln")
	public Long getReceiveriln() {
		return receiveriln;
	}

	public void setReceiveriln(Long receiveriln) {
		this.receiveriln = receiveriln;
	}

	@Column(name="receivercodebyreceiver")
	public Integer getReceivercodebyreceiver() {
		return receivercodebyreceiver;
	}

	public void setReceivercodebyreceiver(Integer receivercodebyreceiver) {
		this.receivercodebyreceiver = receivercodebyreceiver;
	}

	@Column(name="receivername")
	public String getReceivername() {
		return receivername;
	}

	public void setReceivername(String receivername) {
		this.receivername = receivername;
	}

	@Column(name="receiveraddress")
	public String getReceiveraddress() {
		return receiveraddress;
	}

	public void setReceiveraddress(String receiveraddress) {
		this.receiveraddress = receiveraddress;
	}

	@Column(name="created_at")
	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@OneToMany(mappedBy="headerid")
	public Set<Detail> getLines() {
		return lines;
	}

	public void setLines(Set<Detail> lines) {
		this.lines = lines;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

}
